package jpb.error;

import jpb.constant.Reply;
import jpb.constant.ReturnState;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by haol on 2017/4/29.
 */
@RestController
public class ErrorController implements org.springframework.boot.autoconfigure.web.ErrorController {

        private static final String ERROR_PATH = "/error";

        @RequestMapping(value = ERROR_PATH)
        public String handleError(HttpServletRequest request) {
          //      logger.error("找不到页面{}",request.getRequestURI());
                return new Reply(1, "找不到页面").toJson();
        }

        @Override
        public String getErrorPath() {
                return ERROR_PATH;
        }
}
